<?php
/**
 * Created by PhpStorm.
 * User: yvdedu.com
 * Date: 2019/6/24
 * Time: 9:13
 */

namespace app\api\controller\v1;


use app\api\controller\BaseController;
use app\api\service\Token;
use app\lib\exception\UserformException;


class Userform extends BaseController {

    /*** 表单提交
     * @param $wu_id
     * @param $content
     * @return false|int
     * @throws UserformException
     * @throws \app\lib\exception\TokenException
     * @throws \think\Exception
     */
    public function FromSubmission($wu_id,$content){
        $uid = Token::getCurrentTokenVar('t_id');
        $server = new \app\api\service\UserForm();
        $result = $server->FromSubmission($uid,$wu_id,$content);
        if (!$result){
            throw new UserformException([
                "code"=>500,
                "msg"=>'提交成功',
                "error_code"=>100030
            ]);
        }
        return $result;
    }


    /*** 报名预约列表
     * @return false|\PDOStatement|string|\think\Collection
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function AppointmentUser(){
        $server = new \app\api\service\UserForm();
        $result = $server->AppointmentUser();
        return $result;
    }



}